package com.apes.framework.jpa.generator.service;

import com.apes.framework.jpa.generator.model.SequenceDateRange;
import com.apes.framework.util.DateUtil;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 功能：
 *
 * @author xul
 * @create 2019-10-30 17:00
 */
@Data
public class SequenceDateRangeCache implements Serializable {

    public SequenceDateRangeCache(SequenceDateRange sequenceDateRange, Date date) {
        this.sequenceDateRange = sequenceDateRange;
        this.date = date;
    }

    private SequenceDateRange sequenceDateRange;
    private Date date;

    public boolean invalid() {
        return DateUtil.dateCompare(date, new Date()) != 0;
    }
}
